package com.zhichat.web.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhichat.infrastructure.Enums.ApplyStatusEnum;
import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * @ClassName: ApplyInfoVO
 * @Description: 申请信息VO
 * @Author: 团长九哥 https://space.bilibili.com/602197686
 * @CreateDate: 2024/11/17 21:50
 */
@Data
public class ApplyInfoVO implements Serializable {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long id;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long applyId;
    private String applyId2;
    private String applyName;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long receiveId;
    private Integer type;
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long contactId;
    private String lastApplyTime;
    private Integer status;
    private Integer statusName;
    private String applyMessage;

    public String getStatusName() {
        for (ApplyStatusEnum statusEnum : ApplyStatusEnum.values()) {
            if (Objects.equals(statusEnum.getCode(), status)) {
                return statusEnum.getDesc();
            }
        }
        return null;
    }
}
